`ifndef MEM_UNIT
`define MEM_UNIT

module mem_unit #(
	`include "C:/Users/gaoji/Desktop/RISC_SPM/src/para_def.v"
)(
	output     [WORD_WD -1:0] data_out,
	input 	   [WORD_WD -1:0] data_in,
	input      [ADDR_WD -1:0] addr_in,
	input                     write_en,
	input                     clk, rst_n
);

	reg [WORD_WD -1:0] mem[MEM_SIZE -1:0];
	always @(posedge clk)begin
		if(write_en)begin
			if(DISPLAY_EN == 1) $display("%0t, %m, addr-%0d- update to 'b%8b('h%2h-'d%0d)", $realtime, addr_in, data_in, data_in, data_in);
			mem[addr_in] <= data_in;
		end
	end
	assign data_out = mem[addr_in];
	
endmodule//: mem_unit

`endif